#include "stdafx.h"
#include "Algorithm.h"
#include <random>

using namespace std;

void Algorithm::Random::generate(void *data, uint64 size)
{
    random_device rd;
    mt19937_64 rand;
    uniform_int_distribution<> dis(0, 255);
    rand.seed(rd());

    uint8 *p8 = reinterpret_cast<uint8 *>(data);
    uint8 *p8e = p8 + size;
    while (p8 < p8e)
        *p8++ = dis(rand);
}
